#!/bin/bash
# SPDX-FileCopyrightText: © 2012 Hewlett-Packard Development Company, L.P.

# SPDX-License-Identifier: GPL-2.0-only

# Script to install items needed by unit tests on package install systems.
# after items are installed the unit tests are run.  This script assumes it 
# is being run by jenkins.
#
# @version "$Id$"

# This must run as root.
if [ `id -u` != "0" ] ; then
   echo "ERROR: $0 must run as root."
   echo "Aborting."
   exit 1
fi

cd /var/lib/jenkins/workspace/PITUnit/2.0PkgTests/$NODE_NAME/fossology2.0/

utils/fo-installdeps -y -e

# # This is also a valid way to install phpunit
#wget https://phar.phpunit.de/phpunit.phar
#php phpunit.phar

# install PHPUnit (and maybe other dependencies) with composer
cd src
composer install
cd -

echo "would now run tests"
cd src/testing/unit
pwd
# ./runAgentUnit.php

